package com.chain.BrotherExchange.data;

import com.chain.BrotherExchange.utils.Androids;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class AddHeaderInterceptor implements Interceptor {

    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        String language = Androids.LocalConfig.getLanguage();
        return chain.proceed(
                request.newBuilder().header("Content-Language", language)
                        .build()
        );
    }
}
